#import <Foundation/Foundation.h>
#import "ERuntime.h"
#import "ERClass.h"
#import "ERClassAttributes.h"
#import "ERClassType.h"
#import "EUser.h"
#import "ERField.h"
#import "ERMethod.h"
#import "ERProperty.h" 
int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
	
	//EUser *user = [[EUser alloc] init];
	//ERMethod *m = [[EUser erClass] classMethodWithName:@"mapping:"];
	//NSLog(@"%@",m.name);
	
	//test();
	
	NSDate *date = [NSDate date];
	
	[pool drain];
    return 0;
}

void test(){
	//NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
	int count;
	count = objc_getClassList(nil, count);
	if (count) {
		Class *clazzes = malloc(sizeof(Class) * count);
		count = objc_getClassList(clazzes, count);
		
		for (int i = 0; i < count; i++) {
			Class clz = *(clazzes + i);
			char *name = class_getName(clz);
			
			if ([ERClass isSuperClass:[NSObject class] sub:clz]) {
				
				//if ( ![ERClass isSuperClass:[NSString class] sub:clz]){// && ![ER_STRING_ALLOC(name) isEqual:@"NSXMLParser"] && ![ER_STRING_ALLOC(name) isEqual:@"NSXMLSAXParser"]) {
				//NSLog(@"%s",name); 
				ERClass *eclz = [[ERClass alloc]initWith:clz];
				//ERMethod *m = [eclz classMethodWithName:@"mapping:"];
				//if (m) {
				if ([eclz.name isEqual:@"NSString"]){
					//	NSLog(@"%@:%@",eclz.name,m.name);
					NSLog(@"field:%@",[eclz allFields]);
					NSLog(@"method:%d",[[eclz allMethods] count]);
					NSLog(@"prop:%@",[eclz allProperties]);
					NSLog(@"%s",name);
				} 
				[eclz release];
				//}
			} 
			
		}
		
		NSLog(@"%d",count);
		free(clazzes);
	}
	//[pool drain];
}